set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'

"buffer管理与状态栏
Bundle 'vim-airline'

"强大的自动补全，谁用谁知道
Bundle 'Valloric/YouCompleteMe'

"配色
Bundle 'tomasr/molokai'
Bundle 'altercation/vim-colors-solarized'
"STL加入配色
Bundle 'Mizuchi/STL-Syntax'

"代码片段
Bundle 'SirVer/ultisnips'
Bundle 'honza/vim-snippets'

"快速对齐
Bundle 'godlygeek/tabular'

"/自动补全引号 括号等
Bundle 'Raimondi/delimitMate'
"
"/文件树浏览
Bundle 'scrooloose/nerdtree'
"
"/ctags标签提取显示
"Bundle 'taglist.vim'
Bundle 'majutsushi/tagbar'
"
"/自动选择括号等符号中的内容
Bundle 'terryma/vim-expand-region'
"
"一键注释
Bundle 'scrooloose/nerdcommenter'
"Bundle 'comments.vim'

"分层色块
Bundle 'nathanaelkane/vim-indent-guides'

"/显示以及去除行尾空格
Bundle 'bronson/vim-trailing-whitespace'
"
"/多光标同时编辑
"Bundle 'terryma/vim-multiple-cursors'

"/sass scss haml等css开发语言支持
"Bundle 'tpope/vim-haml'

"/less支持
"Bundle 'genoma/vim-less'

"/html xml自动闭合标签
"Bundle 'docunext/closetag.vim'
"
"/自动高亮匹配标签
"Bundle 'gregsexton/MatchTag'
"
"/强大的搜索定位
"Bundle 'easymotion/vim-easymotion'
"
"/符号自动环绕
"Bundle 'tpope/vim-surround'
"/更为强大的重做功能
"Bundle 'tpope/vim-repeat'
"
"Bundle 'rstacruz/vim-ultisnips-css'
"/css的补全
"
"Bundle 'tacahiroy/ctrlp-funky'
"/基于ctrlp的搜索函数等变量名
"
"Bundle 'dyng/ctrlsf.vim'
"/基于ctrlp的文件内容搜索，配合vim－multiple－cursors可以很方便一次修改多个文件的内容
"
"Bundle 'pangloss/vim-javascript'
"/更好的js语法 锁进支持
"
"Bundle 'othree/yajs.vim'
"/更好的js语法高亮
"
"Bundle 'othree/javascript-libraries-syntax.vim'
"/js各类框架 库的高亮支持
"
"Bundle 'maksimr/vim-jsbeautify'
"/格式化js css等
"
"Bundle 'marijnh/tern_for_vim'
"/牛逼的基于语法分析的补全
"
"Bundle 'mbriggs/mark.vim'
"/标记高亮
"
"Bundle 'gorodinskiy/vim-coloresque'
"/颜色符号显示对应颜色
"Bundle 'Xuyuanp/nerdtree-git-plugin'
"/git支持
"
"语法检查
"Bundle 'scrooloose/syntastic'

"python补全插件
"Bundle 'davidhalter/jedi'
"BUF管理
"Bundle 'JavaScript-Indent'

"目录树
"Bundle 'vimplugin/project.vim'
"   Bundle 'git://git.wincent.com/command-t.git'
"   " ...
"   /** vundle命令 **/
"   " Brief help
"   " :BundleList          - list
"   configured bundles
"   :BundleInstall(!)    - install(update) bundles
"   :BundleSearch(!) foo - search(or
"   refresh cache first) for foo
"   :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles  "
"plugin 根据侦测到的不同类型加载对应的插件
"indent 根据侦测到的不同类型采用不同的缩进格式
filetype plugin indent on     " required!   /** vimrc文件配置结束 **/
"End Vundle

"中文支持
let &termencoding=&encoding
set fileencodings=ucs-bom,utf-8,gbk
"启用鼠标
"set mouse=a
"语法高亮
syntax enable
"syntax on
if (&term=="xterm" || &term=="screen-256color")
    set t_Co=256
    set t_Sb=[4%dm
    set t_Sf=[3%dm
else
    set t_Co=256
endif
"let g:solarized_termcolors=256
"colorscheme solarized
colorscheme molokai
"set background=dark
"set background=light
"行号显示
set number
"Statrt Vundle
set nocompatible  "去vi兼容

set go= "无菜单栏及工具栏
set backspace=indent,eol,start whichwrap+=<,>,[,] "解决BackSpace无效

" 不要生成swap文件，当buffer被丢弃的时候隐藏它
setlocal noswapfile
set bufhidden=hide

"热键配置
let mapleader=","
map <Leader>e <End>
map! <Leader>e <End>
imap <Leader>w <Esc> wi
imap <Leader>b <Esc> bi
nmap <Leader>t :call NERDTreeAndTagbar()<CR>
nmap <Leader>n :w<CR>:bn<CR>
nmap <Leader>p :w<CR>:bp<CR>
imap <Leader>l <Right>
imap <Leader>k <Up>
imap <Leader>j <Down>
imap <Leader>h <Left>
imap <Leader>u <Esc>u
nmap <Leader>s :w<CR>
imap <Leader>s <Esc>:w<CR>i<Right>
map <C-4> :qa!<CR>
map! <C-4> <Esc>:qa!<CR>
"注释反注释热键
vmap <Leader>i :Tabularize/
map <Leader>1 :wincmd b<CR>
map! <Leader>1 <Esc>:wincmd b<CR>

set showcmd
set incsearch                                   " 开启实时搜索功能
set ignorecase                                  " 搜索时大小写不敏感
set nocompatible               				    "关闭兼容模式
set wildmenu 				                	" vim 自身命令行模式智能补全
set laststatus=2 	    		            	" 总是显示状态栏
set hlsearch 			    	            	"高亮搜索结果
set shiftwidth=4	    		            	"格式化时制表符占用空格数
set expandtab			    	    	        "将制表符扩展为空格
set tabstop=4				         	        "制表符点用空格数
set softtabstop=4			        	        "连续数量空格视为制表符
set nohlsearch                                     "禁止折行
"高亮显示当前行/列
set cursorline
set cursorcolumn
"显示光标当前位置
set ruler
"set rulerformat=(%2*%

"ultisnips
let g:UltiSnipsExpandTrigger="<Leader>a"
let g:UltiSnipsJumpForwardTrigger="<Tab>"  "可以自行配置，比如我的<,-l>，作用是跳到下一个占位符
let g:UltiSnipsJumpBackwardTrigger="<S-Tab>"
"  "我的<c-h>，上一个占位符

"indent_guides
let g:indent_guides_enable_on_vim_startup=1
let g:indent_guides_start_level=2 "从第二层开始可视化显示缩进
let g:indent_guides_guide_size=1  "色块宽度
let g:indent_guides_auto_colors=1

"NREDTree&&Tagbar
let NERDTreeShowHidden=1
let g:tagbar_vertical = 30
let g:NERDTreeAndTagbar_IsOpen = 0
function! NERDTreeAndTagbar()
    if(g:NERDTreeAndTagbar_IsOpen == 0)
        let g:NERDTreeAndTagbar_IsOpen = 1
        exec 'NERDTree|TagbarOpen'
        exec 'winc b'
    else
        let g:NERDTreeAndTagbar_IsOpen = 0
        exec 'NERDTreeClose|TagbarClose'
    endif
endfunction

"YcmCompleter
let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'   "配置默认的ycm_extra_conf.py
if &filetype == "c"
    let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf_c.py'
else
    let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf_cpp.py'   "配置默认的ycm_extra_conf.py
endif
map <Leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>
map! <Leader>jd <Esc>:YcmCompleter GoToDefinitionElseDeclaration<CR>
"按,F2 会跳转到定义
let g:ycm_confirm_extra_conf=0    "打开vim时不再询问是否加载ycm_extra_conf.py配置
let g:syntastic_always_populate_loc_list = 1
let g:ycm_complete_in_comments = 1 "在注释输入中也能补全
let g:ycm_key_list_select_completion = ['<Down>']
let g:ycm_key_list_previous_completion = ['<Up>']
set completeopt=longest,menu
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
inoremap <expr> <CR>       pumvisible() ? "\<C-y>" : "\<CR>"
inoremap <expr> <Tab>     pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab>    pumvisible() ? "\<C-p>" : "\<S-Tab>"
"inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
"inoremap <expr> <PageUp>   pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
let g:ycm_collect_identifiers_from_tags_files=2	" 开启 YCM 基于标签引擎
let g:ycm_min_num_of_chars_for_completion=1	" 从第2个键入字符就开始罗列匹配项
let g:ycm_cache_omnifunc=0	" 禁止缓存匹配项,每次都重新生成匹配项
let g:ycm_seed_identifiers_with_syntax=1	" 语法关键字补全
let g:ycm_collect_identifiers_from_comments_and_strings = 0  "注释和字符串中的文字也会被收入补全
nnoremap <F5> :YcmForceCompileAndDiagnostics<CR>
let g:ycm_error_symbol = '>>'
let g:ycm_warning_symbol = '>*'
let g:ycm_filetype_blacklist = {
\'tagbar':1,
\'nerdtree':1,
\}
"与windows共享剪贴板
"let clipboard='unnamed'
"set iskeyword+=_,$,@,%,#,-

"highlight OverLength ctermbg=red ctermfg=white guibg=red guifg=white
"match OverLength '\1v.*'
"highlight StatusLine guifg=SlateBlue guibg=Yellow
"highlight StatusLineNC guifg=Gray guibg=White

"echofunc
"let g:EchoFuncLangsUsed = ["java","cpp","c","py","sh","php","js"]
"let g:EchoFuncKeyNext = "<Leader>+"
"let g:EchoFuncKeyPrev = "<Leader>-"

let g:airline_theme="simple"
"let g:airline_theme="luna"
"安装字体后设置此项
"let g:airline_powerline_fonts = 1

let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_nr_show = 1
"设置切换Buffer快捷键"
"nnoremap <C-N> :bn<CR>
"nnoremap <C-P> :bp<CR>

" 关闭状态显示空白符号计数,这个对我用处不大"
let g:airline#extensions#whitespace#enabled = 0
let g:airline#extensions#whitespace#symbol = '!'

"template
